package com.android.Translator.View.MyAdapter;

import java.util.ArrayList;

import com.android.Translator.R;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ListMeanAdapter extends ArrayAdapter<String>{
	private final Activity context;
	private final ArrayList<String> Text;
	private final Integer imageId;
	public ListMeanAdapter(Activity context,
	ArrayList<String> Text, Integer imageId) {
	super(context, R.layout.item_list_mean, Text);
	this.context = context;
	this.Text = Text;
	this.imageId = imageId;
	}
	@Override
	public View getView(int position, View view, ViewGroup parent) {
		LayoutInflater inflater = context.getLayoutInflater();
		View rowView= inflater.inflate(R.layout.item_list_mean, null, true);
		TextView txtTitle = (TextView) rowView.findViewById(R.id.txtListView);
		ImageView imageView = (ImageView) rowView.findViewById(R.id.imgListView);
		txtTitle.setText(Text.get(position));
		imageView.setImageResource(imageId);
		return rowView;
	}
}


